package com.csdj.t309springboot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class ThreadConfig {

    @Bean("taskExecutor")
    public ThreadPoolExecutor taskExecutor(){
        return new ThreadPoolExecutor(8,10,60L, TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(1000));
    }
}
